package thread;

import java.util.TreeMap;

/**
 * Created with IntelliJ IDEA
 * Description：Runnable匿名内部类作参数
 * User：chenshu
 * Date：2023-11-01
 * Time：14:18
 */

public class Demo4 {
    public static void main(String[] args) {
        Thread t = new Thread(new Runnable() {
            @Override
            public void run() {
                while (true) {
                    System.out.println("hello thread!");
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        throw new RuntimeException(e);
                    }
                }
            }
        });
        t.start();
    }
}
